/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.forward.mobile.optitrans.domain;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;

/**
 *
 * @author jbromo
 */
public class DeviceParam {

    private static final String SEPARATOR = ";";
    private long minTime;
    private Timestamp timestamp;
    private String simNumber;
    private String chauffeurImmatricule;
    private String vehiculeMatricule;
    private String uuid;
    private int idChauffeur;
    private int idVehicule;
    private int idDevice;

    public DeviceParam() {
    }

    public DeviceParam(ResultSet resultSet) throws SQLException {
        this.minTime = resultSet.getLong("min_time");
        this.timestamp = resultSet.getTimestamp("id");
        this.simNumber = resultSet.getString("sim_number");
        this.idDevice = resultSet.getInt("id_device");
        this.idVehicule = resultSet.getInt("id_vehicule");
        this.idChauffeur = resultSet.getInt("id_chauffeur");
        this.uuid = resultSet.getString("uuid_device");
        this.vehiculeMatricule = resultSet.getString("immatricule");
        this.chauffeurImmatricule = resultSet.getString("matricule");

        

    }

    public long getMinTime() {
        return minTime;
    }

    public void setMinTime(long minTime) {
        this.minTime = minTime;
    }

    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    public String getSimNumber() {
        return simNumber;
    }

    public void setSimNumber(String simNumber) {
        this.simNumber = simNumber;
    }

    public String getChauffeurImmatricule() {
        return chauffeurImmatricule;
    }

    public void setChauffeurImmatricule(String chauffeurImmatricule) {
        this.chauffeurImmatricule = chauffeurImmatricule;
    }

    public String getVehiculeMatricule() {
        return vehiculeMatricule;
    }

    public void setVehiculeMatricule(String vehiculeMatricule) {
        this.vehiculeMatricule = vehiculeMatricule;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public int getIdChauffeur() {
        return idChauffeur;
    }

    public void setIdChauffeur(int idChauffeur) {
        this.idChauffeur = idChauffeur;
    }

    public int getIdVehicule() {
        return idVehicule;
    }

    public void setIdVehicule(int idVehicule) {
        this.idVehicule = idVehicule;
    }

    public int getIdDevice() {
        return idDevice;
    }

    public void setIdDevice(int idDevice) {
        this.idDevice = idDevice;
    }

    
    public String toSendFormat() {
        StringBuilder builder = new StringBuilder();
        builder.append(minTime);
        builder.append(SEPARATOR);
        builder.append(simNumber);
        builder.append(SEPARATOR);
        builder.append(chauffeurImmatricule);
        builder.append(SEPARATOR);
        builder.append(vehiculeMatricule);
        return builder.toString();

    }

    @Override
    public String toString() {
        return toSendFormat();
    }
}
